-----------------------------------------------------------------------
This file contains button macro examples for the JoyPad plugin.
-----------------------------------------------------------------------

Copy and paste the code snippets from this file into the button macro
files. A list of files can be found in the User manual or in the
textfile "JoyPad Button map.txt".

The following code snippets is for pressing buttons in Mach.
Se Mach documentation for button codes on the forum.

-----------------------------------------------------------------------
Press buttons in Marc from macro:

DoButton 0  ' Run
DoButton 1  ' Pause
DoButton 2  ' Rewind
DoButton 3  ' Stop File
DoButton 4  ' Single Step
DoButton 5  ' Resume
DoButton 6  ' Edit File
DoButton 7  ' Zero All Axis
DoButton 8  ' Zero X
DoButton 9  ' Zero Y
DoButton 10 ' Zero Z
DoButton 11 ' Zero A
DoButton 12 ' Zero B
DoButton 13 ' Zero C
DoButton 14 ' Reset Feed OverRide
DoButton 15 ' Estimate Job
DoButton 16 ' Set Next Line
DoButton 17 ' Goto Zero's
DoButton 18 ' Show Machine Coord.
DoButton 19 ' Show Work Coordinate
DoButton 20 ' Verify Position
DoButton 21 ' Reset
DoButton 22 ' Home X
DoButton 23 ' Home Y
DoButton 24 ' Home Z
DoButton 25 ' Home A
DoButton 26 ' Home B
DoButton 27 ' Home C
DoButton 29 ' SoftLimits Toggle
DoButton 30 ' Radius Tracking Toggle

-----------------------------------------------------------------------
Examples of commands in macro script:

GotoSafeZ    ' Moves to safe z position
Message "Hi" ' Displays the message Hi
SetOEMDRO 818, (GetOEMDRO 818 * 1.1) ' Increase feedrate by 10%

-----------------------------------------------------------------------
Execute G/M codes from macro, examples:

Code "G00 X0" ' Rapid move x to 0
Code "M30" ' End program
Code "M7" ' Mist cooleant on
Code "G28" ' Return home
Code "G31" ' Straight probe

-----------------------------------------------------------------------
As an example of combined macro for button 11 (press the first
joystick) that will reset x and y in current position (M811.m1s):

' This macro is for button 11 (first joystick)
' Reset x and y axe.
DoButton 8 ' Reset x
DoButton 9 ' Reset y

-----------------------------------------------------------------------
Only the imagination will set the limits for button macros.

The documentation for macro script and its uses can be found on the
March support site. Look in the forum and the wiki at:

    http://www.machsupport.com
		http://www.machsupport.com/forum/index.php
		http://www.machsupport.com/MachCustomizeWiki/index.php?title=Main_Page

Happy button macro coding
Joakim

September 2010
